Skip to content

Expose "unparse", FormatNode and RawAST#710

Merged
sparkprime merged 3 commits into
google:masterfrom
charleskorn:expose-unparse
Jun 14, 2023
Merged

Expose "unparse", FormatNode and RawAST#710
sparkprime merged 3 commits into
google:masterfrom
charleskorn:expose-unparse

Conversation

@charleskorn
Copy link
Copy Markdown
Contributor

This is a rebased version of #530 by @tomwilkie:

(Opening this for discussion, see #389)

I've build a little tool that does some modifications to jsonnet files (updating docker image versions in them), and wanted to use the pretty-printing code to write out the modified AST.

This is a minimal set of changes that allow me to do that.

Signed-off-by: Tom Wilkie <tom@grafana.com>
Signed-off-by: Tom Wilkie <tom@grafana.com>
Signed-off-by: Tom Wilkie <tom@grafana.com>
@sparkprime
Copy link
Copy Markdown
Contributor

This does not produce any go_sdk headers files failure I've seen before. I think I fixed it by bumping the version of the bazel/golang integration package that we use.

@sparkprime
Copy link
Copy Markdown
Contributor

I would merge this without worrying about the failing bazel test though... That can be fixed independently.

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 68.568%. remained the same when pulling 3ed30fb on charleskorn:expose-unparse into 9639773 on google:master.

@sparkprime sparkprime merged commit 7b9f5fd into google:master Jun 14, 2023
@charleskorn charleskorn deleted the expose-unparse branch June 15, 2023 00:17
vhata pushed a commit to discord/go-jsonnet that referenced this pull request Aug 30, 2024
* Export FormatNode so external users can pretty print an AST

Signed-off-by: Tom Wilkie <tom@grafana.com>

* Expose RawAST function.

Signed-off-by: Tom Wilkie <tom@grafana.com>

* Add comment

Signed-off-by: Tom Wilkie <tom@grafana.com>

---------

Signed-off-by: Tom Wilkie <tom@grafana.com>
Co-authored-by: Tom Wilkie <tom@grafana.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants